package com.yhp.bean;

import java.util.List;
import java.util.Objects;

public class Grade {
    private Integer gradeId;
    private String gradeName;
    private List<Student> studentList;

    @Override
    public String toString() {
        return "Grade{" +
                "gradeId=" + gradeId +
                ", gradeName='" + gradeName + '\'' +
                ", studentList=" + studentList +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Grade grade = (Grade) o;
        return Objects.equals(gradeId, grade.gradeId) && Objects.equals(gradeName, grade.gradeName) && Objects.equals(studentList, grade.studentList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(gradeId, gradeName, studentList);
    }

    public Integer getGradeId() {
        return gradeId;
    }

    public void setGradeId(Integer gradeId) {
        this.gradeId = gradeId;
    }

    public String getGradeName() {
        return gradeName;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public List<Student> getStudentList() {
        return studentList;
    }

    public void setStudentList(List<Student> studentList) {
        this.studentList = studentList;
    }

    public Grade() {
    }

    public Grade(Integer gradeId, String gradeName, List<Student> studentList) {
        this.gradeId = gradeId;
        this.gradeName = gradeName;
        this.studentList = studentList;
    }
}
